Host adapter system including an integrated PCI buffer controller and XOR function circuit

ABSTRACT

A host adapter system includes a secondary computer bus, a plurality of I/O buses, and a plurality of host adapter circuits. Each host adapter circuit is connected to the secondary computer bus and to one I/O bus in the plurality of I/O buses. An integrated buffer controller and data function circuit is connected to the secondary computer bus and an external buffer memory. The external buffer memory appears to the plurality of host adapter circuits as a host computer buffer memory. The integrated buffer controller and data function circuit includes a data function circuit that is controlled by addresses supplied to the circuit. The integrated buffer controller and data function circuit has a bus interface that is used to connect the circuit to the secondary computer bus. A data channel in the integrated buffer controller and data function circuit connects the bus interface to a buffer memory controller. The buffer memory controller has a buffer memory port that is connected to the external buffer memory. The integrated buffer controller and data function circuit includes a slave data channel and a master data channel.

RELATED APPLICATIONS

This application is related to the following copending, commonly filed,and commonly assigned U.S. patent applications:

1. U.S. patent application Ser. No. 08/617,933, entitled "AN INTEGRATEDPCI BUFFER CONTROLLER AND XOR FUNCTION CIRCUIT," of B. Arlen Young,filed on Mar. 15, 1996 as Attorney Docket No. M-3805 US;

2. U.S. patent application Ser. No. 08/617,991, entitled "A METHOD OFENABLING AND DISABLING A DATA FUNCTION IN AN INTEGRATED CIRCUIT," of B.Arlen Young, filed on Mar. 15, 1996 as Attorney Docket No. M-3803 US;and

3. U.S. patent application Ser. No. 08/615,478, entitled "A HARDWAREMETHOD FOR VERIFYING THAT AN AREA MEMORY HAS ONLY ZERO VALUES," of B.Arlen Young, filed on Mar. 15, 1996 as Attorney Docket No. M-3921 US.

Each of the above applications is incorporated herein by reference inits entirety.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention is related generally to host adapter systems thatcontrol transfer of data between two buses, and more specifically to anintegrated circuit and system for RAID applications that includes ahardware data function.

2. Description of Related Art

The Small Computer System Interface (SCSI) standard, which is specifiedby the American National Standards Institute (ANSI X3.131-1986, which isincorporated herein by reference in its entirety) of 1430 Broadway, NewYork, N.Y. 10018, is an example of an industry-recognized standard for arelatively complex local area network. Descriptions of the SCSI bus maybe found for example in U.S. Pat. No. 4,864,291 "SCSI Converter" issuedSep. 5, 1989 to J. E. Korpi and in U.S. Pat. No. 4,905,184 "AddressControl System for Segmented Buffer Memory" issued Feb. 27, 1990, to R.P. Giridhar, et al., which are incorporated herein by reference in theirentirety.

A typical SCSI system 100 is illustrated in FIG. 1. A plurality ofintelligent devices 120, 140, 141, 142 are coupled to SCSI bus 110 sothat these devices can exchange information. The intelligent devices are(i) a first host system 120, whose internal structure is shown indetail, that includes host adapter system 160 (ii) a second host system140, whose internal structure is similar to that shown for system 120,(iii) a first SCSI disk drive unit (Target-A) 141, and (iv) a secondSCSI disk drive unit (Target-B) 142. The host adapter system in a hostcomputer can be either a single integrated circuit, or a plug-in board.In each case, the host adapter system, hereinafter host adapter,transfers data between a host computer bus, e.g., an ISA bus, an EISAbus, a VME bus, or a PCI bus, and a SCSI bus.

Typically, a software driver, executing on CPU 121 of host computer 120,builds and sends a command block to the host adapter. Each command blockspecifies exactly how a SCSI command is to be executed. Host adapter 160executes the command block, and interrupts host computer 120 to reportcompletion of the execution. Herein, execution of a command block meansperformance of the SCSI command contained in the command block.Consequently, host computer 120 is interrupted at least once for everycommand block.

The architecture in FIG. 1 is typical of that used to interface a singleSCSI bus to a host computer bus. While this configuration can be usedfor RAID applications, a RAID 5 configuration requires manipulation ofdata to create redundancy for fault tolerance and to use the redundancyto recover data lost because of a fault. Data manipulation by softwareis notoriously slow, and uses significant host CPU time.

In another configuration, multiple host adapters, e.g., multiple hostadapters 160, are sometimes used in RAID 5 applications. However, such aconfiguration does not alleviate the problems associated withmanipulation of data with software processes, and does not alleviate theload on either host computer bus 126 or host computer microprocessor121. Consequently, the performance of RAID 5 structures is limited bythe performance of data manipulation using software.

SUMMARY OF THE INVENTION

An integrated buffer controller and data function circuit of thisinvention includes a data function circuit that is controlled byaddresses supplied to the circuit. The integrated buffer controller anddata function circuit has a bus interface that is used to connect thecircuit to a bus on which one or more host adapters are connected sothat both the host adapters and a host computer can transfer data to andfrom the circuit, and supply addresses to control operation of this datafunction circuit.

In one embodiment, the integrated buffer controller and data functioncircuit includes an address decode circuit that receives an addressapplied to the integrated buffer controller and data function circuit.The address circuit generates an active signal on a data function enableoutput line when the applied address is in an alias address space, asecond address space, and an inactive signal when the applied address isin a normal address space, a first address space.

A data channel in the integrated buffer controller and data functioncircuit connects the bus interface to a buffer memory controller. Thebuffer memory controller has a buffer memory port that includes a dataport, a memory address port, and a memory control port. A buffer memoryis connected to the buffer memory port.

A data function circuit in the buffer memory controller is coupled tothe data function enable output line. The data function circuit isselectively connected to the data port.

Specifically, in response to an inactive signal on the data functionenable output line, the memory controller circuit couples the second endof the data channel to the data port. However, in response to an activesignal on the data function enable output line, the buffer memorycontroller couples the output from the data function circuit to the dataport. In one embodiment, the data channel is a slave data channel.

The integrated buffer controller and data function circuit also includesa master data channel connecting the bus interface to the memorycontroller. The master data channel includes a DMA controller connectedto the bus interface, and a master first-in-first-out memory circuitconnected between the DMA controller and the buffer memory controller.

A sequencer in the integrated buffer controller and data functioncircuit is connected to the buffer memory controller and to the DMAcontroller. The sequencer is also connected to a control block memoryport of the integrated buffer controller function circuit. The sequencerexecutes SCSI command blocks so that the integrated buffer controllerand data function circuit appears to the host computer as a host adapterthat in turn communicates with a SCSI target. This allows the driver forthe other host adapters to communicate with the integrated buffercontroller and data function circuit without modification, because thedriver does not know that the integrated buffer controller and datafunction circuit is not connected to a SCSI bus.

In one embodiment, the slave channel automatically transfers databetween the bus connected to the bus interface circuit and the buffermemory. Thus, the integrated buffer controller and data function circuitappears to other host adapters as a host buffer memory.

The data function circuit of integrated buffer controller and datafunction circuit is useful for RAID parity generation. For RAID 5applications, the data function is the XOR function.

According to the principles of this invention, the address used tospecify the storage location of the data streaming from a first deviceto a second device is used in the control of a data function, such asthe XOR function circuit in the integrated PCI buffer controller anddata function circuit. In this embodiment, the address for the datatransfer is used by the address decode circuit to generate an activedata function enable signal to the data function in the buffercontroller. Specifically, an alias PCI address is loaded in the SCSIcommand block for the data destination in the buffer memory when thedata function circuitry is to be enabled. The host adapter system driveror application is notified of the alias address during initialization,and uses the alias address in the construction of SCSI command blocks tospecify that the data shall be operated upon by the data function. Whenno data operation is desired, the normal (non-alias) address isspecified in the SCSI command block.

Thus, for every buffer address of the buffer memory, there is acorresponding alias address which not only addresses the same bufferlocation, but also turns on the data function. Thus, the buffer memorycontroller operates in one of two modes, a direct mode and a datafunction mode. In the first mode, i.e., the direct mode, data are readdirectly from or written directly to the buffer memory. In the firstmode, the normal addresses for the buffer memory are given in the SCSIcommand block.

In the second mode, a data function mode, e.g., an Exclusive OR (XOR)function in this embodiment, is performed on data written to the buffermemory. In the second mode, the alias address for the buffer memory isgiven in the SCSI command block. Thus, an image of the buffer memoryaddress interval is allocated in the address space for buffer memoryaccesses via the data function mode.

In effect, two devices are defined in the address space corresponding tothe two modes of operation. A consequence of this mode selection methodis that the address allocation required for the buffer memory in theaddress space is twice the actual size of the memory.

Hence, a novel method of this invention uses addressing for managing ahost adapter data function that operates on a data stream. The methodrequires no additional control signals and no modification to other hostadapter hardware or firmware. Data function management is automaticduring data transfer, and adds no time to command execution and datatransfer.

According to the principles of this method, the host adapter or otherdevice is assigned two address spaces, a normal address space and analias address space. In the method of this invention for enabling anddisabling a data function in a circuit, one of a first address in afirst set of addresses for the circuit, and a second address in secondset of address for the circuit is applied to the circuit. The datafunction in the circuit is disabled in response to the first addressbeing applied to the circuit. Conversely, the data function in thecircuit is enabled in response to the second address being applied tothe circuit. The first set of addresses define a first address space forthe circuit, and the second set of address define a second address spacefor the circuit.

A host adapter system of this invention includes a secondary computerbus, a plurality of I/O buses, and a plurality of host adapter circuits.Each host adapter circuit is connected to the secondary computer bus andto one I/O bus in the plurality of I/O buses. An integrated buffercontroller and data function circuit is connected to the secondarycomputer bus and an external buffer memory. The external buffer memoryappears to the plurality of host adapter circuits as a host computerbuffer memory.

A method for verifying that an area of memory is zero utilizing onlyhardware is another invention that facilitates use of the integratedbuffer controller and data function circuit in RAID applications. Inthis method, a logic zero value is loaded in a storage element. A unitof data is retrieved from the area of memory being tested for a logiczero value. The logic zero value and retrieved unit of data are appliedas input signals to a logic hardware circuit that has a unique outputsignal for two logic zero input signals. If the output signal from thelogic hardware circuit is not equal to the unique output signal, astatus flag is set. So long as the output signal from the logic hardwarecircuit is the unique value, the retrieving, applying and settingoperations are repeated until all data in the area of memory has beenprocessed. If other than the unique output signal is detected, themethod can be stopped and the address to the non-zero value determined,or alternatively, the number of units of data processed before the errorwas detected can be determined.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is an illustration of a typical prior art SCSI system 100 thatincluded host adapter system 160.

FIG. 2A is an illustration of a host adapter system with the integratedbuffer controller and XOR function circuit of this invention and aplurality of host adapters.

FIG. 2B is a block diagram of a typical configuration for a prior arthost adapter circuit.

FIG. 3 is a block diagram of the integrated buffer controller and XORfunction circuit of this invention.

FIG. 4 is a more detailed diagram of one embodiment of the addressdecode circuit and the buffer memory controller in the integrated buffercontroller and XOR function circuit of this invention.

FIG. 5 is an illustration of one embodiment of the architecture of aSCSI command block that is used with this invention.

FIG. 6 is an execution flow diagram of a chain that accomplishes a RAID5 write operation using the integrated buffer controller and XORfunction circuit of this invention.

FIG. 7 is an execution flow diagram of a chain of this invention thataccomplishes a RAID 5 read operation with a bad data target using theintegrated buffer controller and XOR function circuit of this invention.

DETAILED DESCRIPTION

According to the principles of this invention, an integrated PCI buffercontroller and Exclusive OR (XOR) function circuit 265 performs datamanipulation using dedicated hardware and so eliminates performancedegradations associated with software data manipulation to implement adata function. Further, utilization of the data function circuit, e.g.,the XOR function circuit, does not require any hardware modifications toexisting host adapters, and does not add time to SCSI command execution,or affect the execution of SCSI commands.

Integrated PCI buffer controller and XOR function circuit 265 includeshardware circuitry to perform all data manipulation required for RAID 5applications, a bus interface circuit, a master data channel thatincludes a DMA engine, a slave data channel, a buffer memory controller,and a RISC sequencer. Specifically, the data manipulation required forRAID 5 applications is provided by a hardware XOR function circuitwithin circuit 265.

In one embodiment, the XOR function circuit uses a buffer memory 245 forstoring one of the two XOR operands, and for storing the result of theXOR operation. Buffer memory 245 can also be used for caching RAID 5parity information, which often saves SCSI target read operations. Datacan also be cached or buffered in buffer memory 245. The amount ofcaching and buffering depends primarily on the size of buffer memory245. Buffer memory 245 is typically dynamic random access memory (DRAM)that is between 1 and 16 Mbytes in size.

In the embodiment of FIG. 2, integrated PCI buffer controller and XORfunction circuit 265 and a plurality of host adapters, e.g., hostadapters 260A to 260C, are connected to a secondary PCI bus 236 that inturn is connected to a PCI bus bridge 275.

The basic structure of each of host adapters 260A to 260C is illustratedin FIG. 2B. The components include a PCI bus interface circuit 270, aSCSI bus interface circuit 280, a data first-in-first-out (FIFO) memorycircuit 285 and a RISC sequencer 290. Each of host adapters 260A to 260Calso includes a bus master data channel for DMA transfer of datadirectly between the SCSI bus and a buffer memory, that was previouslythe host buffer memory.

In one embodiment, host adapters 260A to 260C are each a PCI/SCSI hostadapter such as the Adaptec AIC-7870 host adapter, available fromAdaptec, Inc. of Milpitas, Calif. In this embodiment, the PCI businterface circuit, DMA logic, the bus master data channel, and RISCprocessor in integrated PCI buffer controller and XOR functionintegrated circuit 265 are the same hardware as in the Adaptec AIC-7870host adapter.

PCI bus bridge 275 selectively connects and disconnects secondary PCIbus 236 to host computer PCI bus 226, a first PCI bus. As is known tothose of skill in the art, PCI bus bridge 275 is necessary to provide aproper load for host computer PCI bus 226. When PCI bus bridge 275disconnects host adapters 260A to 260C from PCI bus 226, host adapters260A to 260C can transmit data to, and receive data from buffer memory245 over secondary PCI bus 236 through PCI buffer controller and XORfunction circuit 265. Thus, host computer PCI bus 226 and secondary PCIbus 236 operate independently whenever possible. PCI bus bridge 275includes bus mastering capability on both host computer PCI bus 226 andsecondary PCI bus 236.

PCI bus bridge 275, in this embodiment, operates as a concurrent bridge.The bridge data channel has a write-posting buffer and a read pre-fetchbuffer on the host computer PCI side, and also another write-postingbuffer and a read pre-fetch buffer on the secondary PCI side. PCI busbridge 275 supports one transaction posting. The write-posting buffersaccept write data from one bus and acknowledge reception to that bus.PCI bus bridge 275 temporarily stores, e.g., posts, the write data untilthe data can be written on the other bus. The read pre-fetch bufferstake the address from a single read access and read additional dataspeculating that the additional data are needed. PCI bus bridge 275holds the data in a buffer until the data are either unusable, or areused by a read access.

As explained more completely below, to facilitate such data transfers aPCI master data channel and a slave data channel are provided betweenbuffer memory 245 and PCI bus 236, enabling high-speed data transfersbetween buffer memory 245 and host computer PCI bus 226, and betweenbuffer memory 245 and a SCSI device connected to any one of hostadapters 260A to 260C.

In one embodiment, firmware in circuit 265 for the RISC sequencerincludes instructions so that circuit 265 responds to the basic SCSIcommands, such as Read, Write, Read Capacity, Test Unit Ready, andRequest Sense Status. Data transfers between the host computer andbuffer memory 245 are initiated by a driver executing on the hostcomputer sending a SCSI command block to circuit 265 requesting a SCSIRead or Write command. The SCSI CDB contained within the SCSI commandblock contains the logical byte address of buffer memory 245, and thedirection for data flow.

In addition, as explained more completely, the RISC sequencer alsoresponds to vendor unique SCSI commands. In one embodiment, two vendorunique SCSI commands have been implemented in the RISC sequencerfirmware to take advantage of special circuitry within circuit 265 torapidly zero out a segment of buffer memory 245, or to check a segmentof memory 245 for all zeros. Both functions are of value in performingRAID 5 operations, as explained more completely below.

The fastest mode for transferring data between a host buffer memory andbuffer memory 245 is the PCI master mode. A DMA controller is includedin PCI master data channel of integrated buffer controller and XORfunction circuit 265 for use in PCI master mode.

As explained more completely below, the slave data channel in integratedPCI buffer controller and XOR function circuit 265 allows host adapters260A to 260C, to do a DMA data transfer between a SCSI target and buffermemory 245. The selection of one of the host buffer computer memory andbuffer memory 245 for the DMA transfer from the SCSI target is made viathe PCI address conveyed in the SCSI command block for the host adapter.The host adapter executing the SCSI command block has no need to knowwhether the data buffer is in the host computer or connected tointegrated PCI buffer controller and XOR function circuit 265.

FIG. 3 is a more detailed block diagram of integrated PCI buffercontroller and XOR function circuit 265. In this embodiment, an externalbus port 374 of a PCI bus interface circuit 370 is connected tosecondary PCI bus 236. PCI bus interface circuit 370 connects externalbus port 374 to the other circuits within integrated PCI buffercontroller and XOR function circuit 265.

The circuits within PCI bus interface circuit 370 perform the PCI busprotocol for data transfers to and from PCI bus 236. For slave datachannel transfers with one of host adapters 260A to 260C as the master,PCI bus interface circuit 370 recognizes PCI addresses within theaddress range for integrated PCI buffer controller and XOR functioncircuit 265, and passes data from a PCI bus 236 to a first end of aslave data channel 321. For master data channel transfers, PCI businterface circuit 370 generates the PCI address, as provided over masterdata channel 331 by DMA controller 310.

In addition, PCI bus interface circuit 370 contains an address decoder375 which provides the enable control signal over data function enableline 376 for hardware XOR function circuit 345 that in this embodimentis included within buffer memory controller 340. As explained morecompletely below, address decoder 375 receives the PCI address from PCIbus 236 and generates an inactive signal on data function enable line376 for a first set of addresses and an active signal on data functionenable line 376 for a second set of addresses that is different from thefirst set.

Slave data channel 321 connects PCI bus interface circuit 350 to a slavefirst-in-first out memory circuit 320, hereinafter slave FIFO 320, thatin turn is connected to a slave data channel interface of buffer memorycontroller 340. Slave data channel 321 operates automatically withoutcontrol by RISC sequencer 390.

DMA controller 310 manages master data channel transfers at the PCI endof a master first-in-first-out memory circuit 330, hereinafter masterFIFO 330. For a PCI master mode transfer, DMA controller 310 isconfigured by sequencer 390 with the PCI address of the data, the numberof bytes to be transferred, and the data flow direction. DMA controller310 is monitored by sequencer 390 for the end of the data transfer.

Master FIFO 330 and slave FIFO 320 provide data rate matching betweenPCI bus 236 and buffer memory 245 for master data channel 331 and slavedata channel 321, respectively. Master FIFO 330 is typically 64 or 128bytes deep, and slave FIFO 320 is typically 256 bytes deep.

As indicated above, sequencer 390 is the same as that found in hostadapters 260A to 260C, in this embodiment. Sequencer 390 accesses SCSIcommand blocks stored in an external shared memory 255 through anexternal SCB memory port 395. As is known to those of skill in the art,the host adapter system driver uses a PIO data transfer to load the SCSIcommand block into a SCB array in external shared memory 255 through theexternal SCB memory port 395 of integrated PCI buffer controller and XORfunction circuit 265.

After the SCSI command block is loaded in the SCB array, the hostadapter system driver loads a pointer to the SCSI command block in aqueue-in FIFO of sequencer 390. When the pointer is loaded, a queue-incounter is automatically incremented to indicate to sequencer 390 that aSCSI command block is available for processing by sequencer 390.

For a data transfer command from, or to host computer buffer memory in aSCSI command block, sequencer 390 configures and manages DMA controller310 and buffer memory controller 340 for a PCI master mode datatransfer. Thus, in FIG. 3, sequencer 390 is shown as connected to bothDMA controller 310 and buffer memory controller 340. For specialfunctions, such as writing zeros to buffer memory 245 or checking buffermemory 245 for zeros, sequencer 390 manages buffer memory controller 340only. Normally, sequencer 390 interacts only with master data channel331, and not slave data channel 321. Slave data channel 321 operatesautomatically and independently from master data channel 331.

Sequencer 390 emulates a SCSI target by interpreting certain SCSI CDBsand providing an appropriate response back to the host computer.

As described above, the SCB array in shared external memory 255 storesSCSI command blocks received from the host adapter system driverexecuting on the host computer. Each SCSI command block has 32 bytes,and shared memory 255 can store 256 blocks.

Buffer memory controller 340 is the interface between both slave datachannel 321 and master data channel 331 and buffer memory port 350 thatis connected to buffer memory 245. In this embodiment, buffer memoryport 350 includes a memory data bus port, a memory address port, and amemory control port. Buffer memory controller 340 generates addressingsignals over memory address port and control signals over memory controlport that are required by buffer memory 245. In addition, buffer memorycontroller 340 selects the data path through controller 340 to buffermemory 245. Buffer memory controller 340 also contains hardware toimplement special functions that zero buffer memory segments or checkbuffer memory segments for all zeros.

The initial buffer memory address for master data channel transfers isloaded into buffer memory controller 340 by sequencer 390, along withthe total number of bytes to be transferred. Buffer memory controller340 manages the address during the data transfer, and stops the transferafter the specified number of bytes have been transferred.

The initial buffer address for slave data channel transfers is providedto buffer memory controller 340 by PCI bus interface circuit 370. Buffermemory controller 340 increments the address as bytes are transferred toor from buffer memory 245. Buffer memory controller 340, in thisembodiment, does not provide byte count management for data transfersover slave data channel 321. Both master data channel 331 and slave datachannel 321 can be transferring data concurrently. Since there is onlyone data path to buffer memory 245, buffer memory controller 340time-multiplexes between the two data channels.

Buffer memory controller 340 provides all control signals to buffermemory 245. The control signals include the read and write strobes.Control signals are sequenced by buffer memory controller 340 to providesimple memory reads and writes, DRAM refresh, and sequences required bythe XOR function circuit 345.

Hardware XOR function circuit 345 generates an Exclusive OR function ofdata flowing toward buffer memory 245 with the data already stored inbuffer memory 245. The data can flow from either master data channel 331or slave data channel 321. Data are read from buffer memory 245 bybuffer memory controller 340, and the read data are a first input to XORfunction circuit 345. The incoming data are a second input to XORfunction circuit 345. XOR function circuit 345 generates the ExclusiveOR function of the input data, and the result is stored back at the samebuffer memory location, in one embodiment. In another embodiment, theExclusive OR circuit output data are written to another location inbuffer memory 245 so that the original data in buffer memory 245 ispreserved, i.e., cached. Data flowing from buffer memory 245 to eithermaster data channel 331 or slave data channel 321 is passed throughbuffer memory controller 340 unaltered.

The XOR Function is enabled or disabled via an XOR control signal thatis generated by address decode circuit 375 on line 376. As explainedmore completely below, a PCI address determines whether XOR functioncircuit 345 is enabled.

The method used on integrated PCI buffer controller and XOR functioncircuit 265 to enable XOR function circuit 345 is a novel technique thatcan be used for a wide variety of functions other than the XOR functionthat is used herein as an example. SCSI host adapters, such as hostadapters 260A to 260C, basically perform just one service, transfer ofdata between the SCSI bus and a host bus. This service may be augmentedwith functions such as caching and data compression, which are oftenmanaged by a processor onboard the host adapter using software. Thesefunctions, referred to below as "data functions", operate on data toalter the data according to some process, or to combine the data withother data to create new data.

In integrated PCI buffer controller and XOR function circuit 265, theonboard hardware XOR function circuit 345 combines data stored in buffermemory 245 with data streaming from either the SCSI bus or host computerPCI bus 226. The two data operands are XORed together, and the resultreplaces the operand retrieved from buffer memory 245. The XOR functionis executed while the data are streaming, and does not hinder either thestreaming of data, or the execution of the data transfer command. Inother words, the function does not add delays or additional overhead tothe command execution. The hardware data management function isimplemented with a minimum of hardware and firmware such that itshardware is fully compatible with existing host adapter hardware.

According to the principles of this invention, the address used tospecify the storage location of the data streaming from a first deviceto a second device is used in the control of a data function, such asthe XOR function circuit on integrated PCI buffer controller and XORfunction circuit 265. In this embodiment, a PCI address for the datatransfer is used by address decode circuit 375 to generate an active XORcontrol signal to XOR function circuit 345 on line 376. Specifically, analias PCI address is loaded in the SCSI command block for the datadestination in buffer memory 245 when the data function circuitry is tobe enabled. The host adapter system driver or application is notified ofthe alias address during initialization, and uses the alias address inthe construction of SCSI command blocks to specify that the data shallbe operated upon by the data function. When no data operation isdesired, the normal (non-alias) address is specified in the SCSI commandblock.

Thus, for every buffer address of buffer memory 245, there is acorresponding alias address which addresses the same buffer location,but also turns on the data function. Thus, buffer memory controller 340operates in one of two modes, a direct mode and a data function mode. Inthe first mode, i.e., the direct mode, data are read directly from orwritten directly to buffer memory 245. In the first mode, the normal PCIaddresses for buffer memory 245 are given in the SCSI command block.

In the second mode, a data function, e.g., an Exclusive OR function inthis embodiment, is performed on data written to buffer memory 245. Inthe second mode, the alias PCI address for buffer memory 245 is given inthe SCSI command block. Thus, an image of the buffer memory PCI addressinterval is allocated in PCI address space for buffer memory accessesvia the data function mode.

In effect, two PCI devices are defined in the address spacecorresponding to the two modes of operation. A consequence of this modeselection method is that the address allocation required for buffermemory 245 in the PCI address space is twice the actual size of thememory. This is not considered important however because the size of thePCI address space used is small compared to the total PCI address space.

FIG. 4 is a more detailed block diagram of address decode circuit 375and buffer memory controller 340. In FIG. 4, data and address lines fromPCI bus 236 are shown going directly through PCI bus interface circuit370. Also, multiple address connections are shown to PCI bus 236. Thisis illustrative only. As understood by those of skill in the art, PCIbus interface circuit 370 includes all circuitry necessary to obtainconformity with the PCI bus specification. However, for an understandingof the novel features of this invention, the particular operationsperformed by PCI bus interface circuit 370 are not of importance.

Further, the use of a PCI bus is illustrative only. In view of thisdisclosure, those of skill in the art can use the principles of thisinvention with any of the computer buses found in a host computer.

In either a direct master mode, or direct slave mode transfer, RISCsequencer 390 configures memory read/write sequencer 441 for a directoperation. Memory read/write sequencer 441 generates a signal on modeselect line 446 to multiplexer 443 so that buffer memory data bus port455 to memory buffer 245 is connected to direct bus terminals 450, whichin turn are connected to multiplexer 442. As indicated above,multiplexer 442 is used by memory read/write sequencer 441 to timemultiplex the access to buffer memory 245 between slave data channel 321and master data channel 331. Accordingly, the channel select signal online 445 connects the data bus from buffer memory 245 directly to eitherslave FIFO 320 or master FIFO 330. In this configuration, buffer memory245 is accessed in a word mode to achieve the desired bandwidth, i.e.,the address and control signals generated by memory read/write sequencer441, which is sometimes referred to herein as read/write sequencer 441,in the direct mode do either a word mode read or a word mode write.Also, the memory address for buffer memory 245 in direct slave mode isderived directly from the address on secondary PCI bus 236.

Preferably, all reads from buffer memory 245 to PCI bus 236 areperformed using the direct mode. However, writes to buffer memory 245can be performed in either the direct mode or the data function mode. Asexplained above, a direct mode write can be performed directly throughmultiplexer 443. Alternatively, a direct mode write could be performedby writing zeros in XOR operand register 444 and connecting buffermemory data bus port 455 to terminals 452 that supply the output signalfrom XOR function circuit 345. In this configuration, data for allwrites, either direct or data mode, are streamed to XOR function circuit345.

The data function mode is useful for RAID parity generation. For RAID 5applications, the data function is the XOR function. The data functionmode preferably is used only for writes to buffer memory 245.

In this embodiment, selected bits from the address on PCI bus 236 areloaded in a DRAM address register 371 in address decode circuit 375 ofPCI bus interface circuit 370. The bits selected from the PCI addressdepends on the size of buffer memory 245. As indicated above, buffermemory 245, in one embodiment, ranges from 1 to 16 Mbytes. In anotherembodiment, buffer memory could be as large as 256 Mbytes. For a givensize, sufficient bits must be selected from the PCI memory address toaddress each location in buffer memory and to provide additional bits todistinguish between the normal and alias addresses.

The higher order bits of the DRAM address, e.g., the four mostsignificant bits, in DRAM address register 371 are a first input to acomparator 373 in address decode circuit 375. The corresponding numberof higher order bits from the alias base address for buffer memory 245that is stored in an alias DRAM base address register 372 in PCI businterface circuit 370 are a second input to comparator 373. When thebits from register 371 are equal to or greater than the bits fromregister 372, an active signal is driven on data function enable line376 by comparator 373.

The DRAM address supplied to buffer memory controller 340 is generatedby the lower order bits in DRAM address register 371 that are not usedin determining whether the address is an alias address. The particularbits used to construct the address for buffer memory controller 340 andused to provide input signals for comparator 373 are illustrative only.Those skilled in the art can achieve the two functions in a variety ofcircuit implementations. One important aspect is that the same locationis always addressed in buffer memory 245 independent of whether thedirect mode, that uses the normal address, or the data function mode,that uses the alias address, is activated.

For example, if integrated PCI buffer controller and XOR functioncircuit 265 has a PCI address space allocation of 1100 0000 through 11FFFFFF for direct mode. The PCI address space allocation for the datafunction mode, i.e., the alias address space, could be 1200 0000 to 12FFFFFF. In this example, an alias address of 1202 1234 would be convertedto an address of 02 1234 by address decode circuit 375 and the XORfunction would be enabled.

When integrated PCI buffer controller and XOR function circuit 265 is inslave mode, memory read/write sequencer 441 generates a slave modesignal on channel select line 445. In response to the slave mode signalon line 445, buffer circuit 471 passes the DRAM address from register371 to address select multiplexer 480 over bus 378. (Herein, addressselect multiplexer 480 is used to clearly demonstrate the source of theaddress for buffer memory 245. Those of skill in the art will recognizethat the functionality provided by multiplexer 480 is typically includedwithin memory read/write sequencer 441.)

In response to the slave mode signal on channel select line 445, addressselect multiplexer 480 passes the DRAM address on bus 378 to memoryread/write sequencer 441. If the address on PCI bus is an alias address,memory read/write sequencer 441 also receives an active signal on datafunction enable line 376.

In response to the active signal on line 376 and the DRAM memory addressfrom bus 378, memory read/write sequencer 441 performs aread/modify/write sequence. Specifically, in this embodiment, memoryread/write sequencer 441 connects buffer memory data bus port 455 toterminals 451 of multiplexer 443 which in turn are connected to XORoperand register 444. While in this embodiment, an XOR operand register444 is described, this is illustrative only of a storage element, and isnot intended to limit the invention to a register. Those of skill in theart will appreciate that XOR operand register 444 could be implementedas a FIFO memory, for example.

Memory read/write sequencer 441 also provides the DRAM address andcontrol signals to buffer memory for a word read from the location inbuffer memory 245 indicated by the DRAM address, and clocks the word ofdata into XOR operand register 444. In this embodiment, a word is fourbytes. Alternatively, a page access could be used. The particular methodused to store and retrieve data from buffer memory 245 is determined bythe type of memory used and the speed requirements for the circuit. Theparticular method selected for addressing buffer memory 245 is not anessential aspect of this invention.

The data in XOR operand register 444 is a first operand to XOR functioncircuit 345. The second operand to XOR function circuit 345 is a word ofdata from slave FIFO 320, i.e., the data that is streaming from PCI bus236. XOR function circuit 345 performs a word Exclusive OR function onthe word from register 444 and the word from slave FIFO 320.

After the data are loaded into XOR operand register 444, memoryread/write sequencer 441 generates a signal on mode select line 446 thatconnects the output signals of XOR function circuit 345 on terminals 452of multiplexer 443 to buffer memory data bus port 455 so that the datafrom XOR function circuit 345 is supplied to buffer memory 245. Memoryread/write sequencer 441 generates control and address signals to buffermemory 245 so that the data from XOR function circuit 345 is writtenback to the same location in buffer memory 245 from which the firstoperand was read using a word write of 32-bits. Word reads and writes of32-bits are also done for boundary conditions. At a boundary, only thebytes of interest are processed. After the data are written in buffermemory 245, memory read/write sequencer 441 increments the DRAM memoryaddress.

Thus, in the data function mode of operation, two buffer memory cyclesare required for each PCI bus cycle. However, since the same address isused for the read and the write to buffer memory 245, one addresssettling time for buffer memory 245 has been eliminated in thisembodiment. Of course, there is no requirement that the XORed data bewritten back to the same location in buffer memory 245. In this case,both address settling times for buffer memory 245 must be considered.

There are many advantages to the control method of this invention. Adata function can be automatically turned on or off by the start of adata transfer. The data function turn-on and turn-off is implicit, andrequires no explicit action by the host computer or onboard processorson host adapters. Consequently, no portion of the command execution timeis spent managing the data function.

After the SCSI command block has been constructed, neither the hostcomputer processor nor the host adapter processors have anything to dowith operation of the XOR function circuit in integrated PCI buffercontroller and XOR function circuit 265. Consequently, circuit 265 iscompletely self-contained, and operates independent of other hostadapter devices. No interconnects to other devices in addition to thePCI bus are required for control of the data function. No microprocessoris required on the host adapter to control the data function circuit. Nomodifications are required to other host adapter hardware devices ortheir firmware to operate with integrated PCI buffer controller and XORfunction circuit 265. Integrated PCI buffer controller and XOR functioncircuit 265 can simply be added onto the PCI bus, and accessed by otherdevices as if it were host memory. The data function control circuitryis very simple.

This simplicity and independence contrasts sharply with other prior artalternatives. For example, separate control lines between a host adapter260A, for example, a device such as integrated PCI buffer controller andXOR function circuit 265 could be used. This, of course, would requireadditional pins on both circuits for such control lines. The RISCsequencer in host adapter 260A would activate the control lines to turnon or off the data function prior to the data transfer. Additional RISCsequencer firmware and execution time would be required for this methodof data function control. Also, integrated PCI buffer controller and XORfunction circuit 265 would require redesign in order to use the datafunction.

Yet another method would require no additional hardware control lines.Immediately prior to each data transfer, the data transfer device couldsend a control message along the PCI bus to integrated PCI buffercontroller and XOR function circuit 265 to tell circuit 265 to turn thedata function on or off. Not only would this create a delay in the datatransfer, but the RISC processor in the host adapter would have to knowthe PCI address of the message destination. Currently, such processorshave no knowledge of other device addresses, and additional resourceswould be required for them to gain and store such knowledge.

Integrated PCI buffer controller and XOR function circuit 265 isparticularly advantageous for RAID 5 applications. In one embodiment, aRAID manager, executing on the host computer, specifies a sequence ofSCSI commands for a RAID 5 write operation. The host adapter systemdriver in response to the sequence of commands specified by the RAIDmanager builds a plurality of chained SCSI command blocks to manage thetime-sequencing of the execution of the chain of commands contained inthe SCSI command blocks. One method for chaining SCSI command blocks isdescribed in commonly filed and commonly assigned U.S. patentapplication Ser. No. 08/617,990 entitled "A METHOD FOR SPECIFYING ASEQUENCE OF EXECUTION OF I/O COMMAND BLOCKS IN A CHAIN STRUCTURE," of B.Arlen Young, filed on Mar. 15, 1996, Attorney Docket No. M-3804, whichis incorporated herein by reference in its entirety.

The SCSI command blocks in a chain each includes a sequencer controlblock (SCB) such as that described in U.S. patent application Ser. No.08/269,491, filed on Jun. 30, 1994, entitled "A SCB ARRAY EXTERNAL TO AHOST ADAPTER INTEGRATED CIRCUIT" of Michael D. Brayton et al. and U.S.patent application Ser. No. 08/269,463, filed on Jun. 30, 1994, entitled"METHOD FOR ACCESSING A SEQUENCER CONTROL BLOCK BY A HOST ADAPTERINTEGRATED CIRCUIT" of B. Arlen Young, each of which is incorporatedherein by reference in its entirety. The sequencer control blocks arechained together by information added within the sequencer controlblock, or alternatively appended to the sequencer control block.Sequencer control blocks are illustrative only of an I/O command blockand are not intended to limit the invention to the particular blocksdescribed. In view of this disclosure, the principles of this inventioncan by utilized with any control block to a host adapter system.

Briefly, a SCSI command block 500 (FIG. 5) includes the prior artsequencer control block 550 and a chain control block 560 that is usedto chain sequencer control block 550 to sequencer control blocks inother SCSI command blocks. Chain control block 560 includes controlbits, control counts, and pointers, and in one embodiment is containedin three bytes that are appended to sequencer control block 550. Thethree bytes are a chain control byte 510, a next block pointer byte 520,and an offshoot block pointer byte 530.

Chain control byte 510 of SCSI command block 500 includes a holdoff flag502, a concurrent flag 503, an abort flag 504, an aborted flag 505, anda progress count 506. The sequencer control block is executed in amanner that is similar to execution of prior art unchained sequencercontrol blocks. However, some additional firmware may be included toallow aborting a SCSI command block in the chain.

Upon completion of execution of the sequencer control block, the RISCsequencer executes a chain control process, i.e., a chain manager, thatmay enable start of execution of the next SCSI command block; that maypost completion of the chain; or that may simply decrement the progresscount in a following SCSI command block on the chain path, and return toan idle loop. A more detailed description of the chain control processin presented in U.S. patent application Ser. No. 08/269,463 entitled"METHOD FOR ACCESSING A SEQUENCER CONTROL BLOCK BY A HOST ADAPTERINTEGRATED CIRCUIT," of B. Arlen Young, and that description isincorporated herein by reference.

The particular aspects of the chain control process are not essential tothis invention, because the invention also provides a performanceadvantage for unchained SCSI command blocks. Thus, in the followingdescription, the operation of integrated PCI buffer controller and XORfunction circuit 265 is described without the specific details ofcontrolling the sequence of RAID 5 operations through chaining.

FIG. 6 is an execution flow diagram of a chain 607 of SCSI commandblocks that accomplishes a RAID 5 write operation. As shown in FIG. 6,SCSI command block 600A includes instructions for a SCSI write transferfrom the host computer memory to buffer memory 245. SCSI command block600B includes instructions for a SCSI read transfer from a diskconnected to one of host adapters 260A to 260C to buffer memory 245. APCI alias address is specified for buffer memory 245 in SCSI commandblock 600B so that an Exclusive OR of the data in buffer memory 245 andthe data from the disk is generated by circuit 265. SCSI command block600C also includes instructions for a SCSI read transfer from a disk tobuffer memory 245. The PCI alias address is specified for buffer memory245 in SCSI command block 600B so that an Exclusive OR of the data inbuffer memory 245 and the data from the disk is generated by circuit265. SCSI command block 600E includes instructions for a SCSI writetransfer of the parity data generated as a result of the execution ofblocks 600A to 600C from buffer memory 245 to a disk. SCSI command block600D includes instructions for a SCSI write transfer of the new data tothe target disk drive. This SCSI write transfer could be either frombuffer memory 245 or the host computer memory.

Table 1 gives the state of SCSI command blocks 600A to 600E when chain607 is built by host adapter driver 205 and loaded in shared memory 255for host adapters 260A to 260C and PCI buffer controller and XORfunction circuit 265.

                  TABLE 1    ______________________________________    STATE OF CHAIN CONTROL BLOCK    FOR INITIATION OF    A RAID 5 WRITE SEQUENCE    SCSI                              Next Offsht    CMD  Progress   Concurrent                              Holdoff Blk  Blk    BLK  Count      Flag      Flag    Ptr  Ptr    ______________________________________    600A 1          0         0       600B 600A    600B 1          1         1       600C 600D    600C 15         0         1       600E 600C    600D 2          0         1       600D 600D    600E 2          0         1       600D 600E    ______________________________________

SCSI command block 600A is at the head of chain 607, and is enabled toexecute by the host adapter system driver because holdoff flag 602A isreset. The holdoff flags in SCSI command blocks 600B to 600D areinitially set. After the host adapter system driver builds chain 607,the driver transfers chain 607 to memory 255 and places pointers to theappropriate blocks in the chain in the queue-in FIFOs of host adapters260A to 260C and circuit 265. In this embodiment, a pointer to SCSIcommand block 600A is placed in the queue-in FIFO of circuit 265 andSCSI command blocks 600B to 600D are placed the appropriate queue-inFIFOs of host adapters 260A to 260C.

RISC sequencer 390 in circuit 265 initiates execution of SCSI commandblock 600A. Specifically, RISC sequencer 290 configures DMA controller310 for the master mode so that circuit 265 operates as a PCI master inthe transfer of data from the host computer memory to buffer memory 245over master data channel 331.

RISC sequencer 390 also configures memory read/write sequencer 441 sothat memory read/write sequencer 441 configures multiplexer 442 andmultiplexer 443 so that the data are transferred from master datachannel 331 directly through buffer memory controller 340 to buffermemory 245. Specifically, RISC sequencer 390 retrieves the initialbuffer memory address from the current SCSI command block and providesthat address to read/write sequencer 441. Since circuit 265 is operatingin the direct mode, the PCI address specified in SCSI command block 600Aas the destination address contains the address for buffer memory 245.

Read/write sequencer 441, in this embodiment, includes an addressdecoder similar to that described above in PCI bus interface circuit370. Using this address decoder, read/write sequencer 441 determineswhether the buffer memory address is an alias address or a normaladdress and generates the appropriate signal on mode select line 446 formaster mode operations. In another embodiment, a single address decoderis used in both PCI bus interface circuit 370 and read/write sequencer441.

As indicated above, sequencer 390 also loads the total number of bytesto be transferred into memory read/write sequencer 441. Sequencer 390also initializes DMA controller 310 in master data channel 331, asdescribed above. Memory read/write sequencer 441 manages the address forbuffer memory 245 during the data transfers and stops the transfer atthe total number of bytes. This initial data transfer executes atmaximum PCI bus speed.

When the data transfer from host computer memory to buffer memory 245 iscomplete, SCSI command blocks 600B and 600C are enabled for execution byRISC sequencer 390 and RISC sequencer 390 enters an idle loop. The hostadapter that executes SCSI command block 600B is the master of the datatransfer from the disk to buffer memory 245. Accordingly for thistransfer, slave data channel 321 is utilized for the data transfer tobuffer memory 245.

As the data are read in response to the read command in SCSI commandblock 600B and transferred to circuit 265 an alias PCI address forbuffer memory is specified. Thus, when the selected bits of the aliasPCI address are loaded in DRAM address register 371, the higher orderbits of the address in DRAM address register 371 are greater than orequal to the higher order bits of the alias base address in alias DRAMbase address register 372. Consequently, comparator circuit 373generates an active signal on data function enable line 376 to buffermemory controller 340 to indicate that buffer memory controller 340 isto operate in the data function mode.

Thus, memory read/write sequencer 441 performs the read/modify/writesequence in writing the transferred data to buffer memory 245, asdescribed above. Thus, hardware XOR function circuit 345 in circuit 265combines the data in memory 245 with the read data in an Exclusive ORfunction (XOR) and writes the result of the Exclusive OR function backto memory 245.

The operations for SCSI command block 600C are the same as the for 600Bwith a different source of the read data and so the description of thoseoperations is not repeated. When the read transfers in SCSI commandblocks 600B and 600C are both complete, the new parity data for the newdata are stored in buffer memory 245.

When SCSI command block 600E is executed, the new parity data arewritten from buffer memory 245 to the appropriate disk drive. The hostadapter that executes SCSI command block 600E is the master of the datatransfer from buffer memory 245 to the disk drive. Accordingly for thistransfer, slave data channel 321 is utilized for the data transfer frombuffer memory 245.

However, since the data function is not needed, the actual address isspecified for the location in buffer memory 245. Consequently, thesignal on data function enable line 376 is inactive, and buffer memorycontroller 340 operates in the direct mode. Data are transferreddirectly from buffer memory 245 to slave FIFO 320, as described above.

When SCSI command block 600D is executed, the new data are written fromeither buffer memory 245, or host computer memory to the appropriatedisk drive. The host adapter that executes SCSI command block 600D isthe master of the data transfer. If the data transfer is from buffermemory 245 to the disk drive, the data transfer is similar to that justdescribed for SCSI command block 600E, but the data will have beencached initially in a different location in buffer memory 245.Accordingly for this transfer, slave data channel 321 is utilized in thedirect mode for the data transfer from buffer memory 245.

Again, since the data function is not needed, the actual address isspecified for the location in buffer memory 245. Consequently, thesignal on data function enable line 376 is inactive, and buffer memorycontroller 340 operates in the direct mode. Data are transferreddirectly from buffer memory 245 to slave FIFO 320, as described above,and then to the specified disk drive.

Normally, a RAID 5 read operation is done through execution of a singleSCSI read command to the data target. In the event that a normal RAID 5read fails, the redundancy in the stripe across all RAID 5 targets mustbe used to recover the data lost on the failing target. The data fromall drives is XORed together, and the result is recovered data, which istransferred to the host buffer.

The sequence of SCSI command block execution for such an operation is achain of SCSI command blocks 707. In this example, the RAID array hasfive targets, one of which has been identified as bad. FIG. 7 is anexecution flow diagram for chain 707 that accomplishes a RAID 5 readoperation with a bad data target.

As shown in FIG. 7, SCSI command block 700A includes instructions for aSCSI read transfer from a SCSI target to buffer memory 245. Since thisis the initial transfer, the actual PCI address is used as thedestination address. SCSI command block 700B includes instructions for aSCSI read transfer from the disk to buffer memory 245. Since anExclusive OR of the data in buffer memory 245 and the data from the diskis desired, an alias PCI address is used as the destination address.Similarly, SCSI command blocks 700C and 700D each include instructionsfor a SCSI read transfer from a disk to buffer memory 245 and includethe alias PCI address. SCSI command block 700E includes instructions fora read transfer of the reconstructed data generated as a result of theexecution of blocks 700A to 700D from buffer memory 245 to the hostcomputer memory.

Table 2 gives the state of SCSI command blocks 700A to 700E when chain707 is built by the host adapter system driver and loaded in sharedmemory 255 for host adapters 260A to 260C and PCI buffer controller andXOR function circuit 265.

                  TABLE 2    ______________________________________    STATE OF CHAIN CONTROL BLOCK    FOR INITIATION OF    A RAID 5 READ SEQUENCE    WITH A BAD TARGET    SCSI                              Next Offsht    CMD  Progress   Concurrent                              Holdoff Blk  Blk    BLK  Count      Flag      Flag    Ptr  Ptr    ______________________________________    700A 1          0         0       700B 700A    700B 1          1         1       700C 700B    700C 15         1         1       700D 700C    700D 15         0         1       700E 700D    700E 3          0         1       700E 700E    ______________________________________

After the host adapter system driver builds chain 707, host adapterdriver 205 transfers chain 707 to memory 255 and places pointers to theappropriate blocks in chain 707 in the queue-in FIFOs of host adapters260A to 260C and circuit 265. In this embodiment, a pointer to SCSIcommand block 700E is placed in the queue-in FIFO of circuit 265, andpointers to SCSI command blocks 700A to 700D are placed in theappropriate queue-in FIFOs of host adapters 260A to 260C.

The execution of the various blocks is similar to that described aboveand so is not described in further detail. For block 700A, circuit 265functions in the direct slave mode, while for blocks 700B to 700D,circuit 265 functions in the data function slave mode. For block 700E,circuit 265 functions in the direct master mode.

A bad target in a RAID 5 array is replaced with a good target. The newgood target must be initialized with the data formerly residing in thebad target. The data are reconstructed for the new target again usingthe redundancy of the RAID 5 stripe across the original good targets.The chain and its execution sequence are exactly the same as forrecovering the data from a bad target, except instead of transferringthe recovered data to the host, it is transferred to the new target.Therefore, the operation performed by SCSI command block 700E is changedfrom a buffer memory 245 to host computer memory transfer to a buffermemory 245 to SCSI target transfer. Everything else remains the same.

In the above examples, specific data was initially written to buffermemory 245 and the data function mode of circuit 265 was utilized whenan Exclusive OR function was required. However, performance can beenhanced by initialing an area in buffer memory 245 to zero. When thearea in buffer memory 245 is initialized to zero, all data transfersfrom SCSI devices can be initiated concurrently and written to buffermemory 245 using the data function mode of circuit 265. Thus, theinitial data transfer in the direct mode that effectively initializesthe area of buffer memory 245 is no longer required.

As indicated above, integrated PCI buffer controller and XOR functioncircuit 265 includes firmware for sequencer 390 to cause circuit 265 toinitialize an area of buffer memory 245 to zero. Specifically, zero iswritten to a pattern register 491. Next, sequencer 390 provides buffermemory controller 340 with the starting address in buffer memory 245 andthe size of the transfer. Sequencer 390 selects a master mode transferand so the buffer memory address from memory read/write sequencer 441 ispassed through address select multiplexer 480. Also, the zero from thepattern register is written in the direct mode to memory 245 by buffermemory controller 340 through multiplexers 442 and 443, and soinitializes the area in buffer memory 245 to zero. There is no datatransfer across the host computer bus or secondary PCI bus 236associated with this transfer.

Another vendor specific command is a check zero command. In response tothis command, sequencer 390 configures buffer memory controller 340 toscan an entire area in buffer memory 245 and confirm that each byte iszero.

The check zero command is useful in verifying the parity of a RAID 5stripe. In this process, initially, command write zero is used toinitialize an area of buffer memory 245 to zero. Read commands with analias destination address for buffer memory 245 are issued to all SCSItargets, both data and parity, on the RAID 5 stripe. Thus, as the stripeis transferred from the SCSI target to buffer memory 245, integrated PCIbuffer controller and XOR function circuit 265 is in the slave datafunction mode. Consequently, the data from the SCSI target is passedthrough Exclusive OR function circuit 345 and combined by the ExclusiveOR function with the data in the area of buffer memory that wasinitially set to zero.

If the stripe parity is valid, when all data transfers have completed,the buffer area contains only zeros. Command check zero is used toverify that the area of buffer memory 245 contains only zeros.

In response to command check zero, sequencer 390 again loads the patternregister with zero. Sequencer 390 also provides buffer memory controller340 with the starting address of the area in buffer memory 245 and thelength of the area. Buffer memory controller 340 uses the data functionread/modify/write process to verify the area in buffer memory 245. Thezero in pattern register 491 is the second operand to XOR functioncircuit 345 and the data from memory 245, i.e., a unit of data is loadedin XOR operand register 444, i.e., loaded in a storage element. Theoutput signal from Exclusive OR function circuit 345 is checked byhardware for a zero value, e.g., the output of Exclusive OR function isconnected to a clock terminal of a register. If a non-zero location isdetected, the rising edge clocks the register so that a status byte isset to a predetermined non-zero value. Since this check is doneautomatically with only hardware in buffer memory controller 340, thecheck is performed rapidly in comparison to using sequencer 390 to readeach byte and perform the comparison, for example.

The hardware Exclusive OR function is used in this embodiment, becausethis data function is available. However, this process works with anylogic function that has a unique output signal for two logic zero inputsignals and a different output signal for one logic zero input signaland one logic one input signal, i.e., the logic function has a uniqueoutput signal for two logic zero input signals. Also, the unit of datachecked can be a byte, or a word, where a word can be 2, 4 or 8 bytesfor example. Further, a page of data could be retrieved from buffermemory 245 and stored in a data FIFO storage element, and then checked aunit of data at a time.

The above embodiment of this invention are illustrative only of theprinciples of this invention and is not intended to limit the inventionto the specific embodiment disclosed. In view of this disclosure, thedata function circuit and the method for selectively enabling the datafunction circuit can be used in a wide variety of applications.

I claim:
 1. A host adapter system comprising:a secondary computer bus; aplurality of an I/O buses; a host adapter circuit wherein said hostadapter circuit is connected to said secondary computer bus, and to saidI/O bus; an external buffer memory; and an integrated circuit includinga buffer controller and a data function circuit, said integrated circuitis connected to said secondary computer bus and to said external buffermemory wherein said external buffer memory is accessible to said hostadapter circuit through said integrated circuit and further wherein saiddata function circuit receives a plurality of input signals, with atleast one of said plurality of input signals being one of (a) data fromsaid external buffer memory, and (b) data from said secondary computerbus, and combines said plurality of input signals to generate a singleoutput signal that is written to said external buffer memory.
 2. A hostadapter system as in claim 1 wherein said integrated circuit furthercomprises:a bus interface circuit including an address decode circuithaving a data function enable output line,wherein said address decodecircuit generates an inactive signal on said data function enable outputline for a first set of addresses; and said address decode circuitgenerates an active signal on said data function enable output line fora second set of addresses different from said first set of addresses; abuffer memory controller comprising:a buffer memory port including adata port and a data function circuit coupled to said data functionenable output line, and selectively connected to said data port; and adata channel having a first end connected to said bus interface circuitand a second end connected to said buffer memory controllerwherein inresponse to an inactive signal on said data function enable output line,said buffer memory controller couples said second end of said datachannel to said data port; and in response to an active signal on saiddata function enable output line, said buffer memory controller couplessaid data function circuit to said data port.
 3. A host adapter systemas in claim 2 wherein said data channel is a slave data channel.
 4. Ahost adapter system as in claim 3 wherein said integrated circuitfurther comprises:a master data channel connecting said bus interfacecircuit to said buffer memory controller.
 5. A host adapter system as inclaim 4 wherein said master data channel further comprises:a DMAcontroller connected to said bus interface circuit.
 6. A host adaptersystem as in claim 5 wherein said master data channel furthercomprises:a master first-in-first-out memory circuit connected betweensaid DMA controller and said buffer memory controller.
 7. A host adaptersystem as in claim 2 wherein said integrated circuit further comprises:asequencer connected to said buffer memory controller.
 8. A host adaptersystem as in claim 3 wherein said slave data channel further comprises:aslave first-in-first-out memory circuit connected between said businterface circuit and said buffer memory controller.
 9. A host adaptersystem as in claim 1 wherein said secondary computer bus is a PCI bus.10. A host adapter system as in claim 2 wherein said data functioncircuit is an Exclusive OR function circuit.
 11. A host adapter systemas in claim 7 further comprising another memory external to saidintegrated circuit wherein said another memory is coupled to saidsequencer.